package main

import (
	"github.com/gin-gonic/gin"
)

func setupRouter() *gin.Engine {
	r := gin.Default()
	r.GET("/ping", func(c *gin.Context) {
		c.String(200, "pong")
	})

	r.POST("/reg", func(c *gin.Context) {

		name := c.DefaultPostForm("name", "")
		if len(name) == 0 {
			c.String(200, "error")
			return
		}

		c.String(200, "success")
	})

	return r
}

func add(a int, b int) int {
	return a + b
}

func main() {
	r := setupRouter()
	r.Run(":8080")
}


